perm filename LRNMUS.DGL[UP,DOC]8 blob sn#181020 filedate 1975-10-13 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	1-1  STEP BY STEP INSTRUCTIONS FOR A BASIC SOUND PROGRAM  PAGE 3-1
C00016 ENDMK
C⊗;
1-1  STEP BY STEP INSTRUCTIONS FOR A BASIC SOUND PROGRAM  PAGE 3-1

ABSTRACT: This file  lists a procedure whereby one  can interactively
set  up and hear a  sound directly in NEWMUS.  Its purpose is basicly
didactic and it is not recommended that you do more  than familiarize
yourself with  the interactive possibilities of  writing instruments,
etc. directly  into NEWMUS. You should then learn how to set up files
to contain  all  the information  NEWMUS needs,  since  files can  be
edited, console additions to NEWMUS cannot.

NOTE: The name of the music compiler for 220 is called MUS14. It is 
a version of a program called NEWMUS.  Hence, in this file, where it
says NEWMUS, MUS14 is meant. The only places where the distinction is
necessary have been changed to conform to this.

NOTE: Statements at extreme left margin are your input to the system.
Statements  in quotes at  the left  margin are computer  responses to
your actions.

**********
	GENERAL OMNIBUS ERROR RECOVERY FORMULA:
	This won't make any sense yet, but just remember it for later:
	If something goes wrong after you have done the R NEWMUS command
	and are inside NEWMUS  (such as an error message, or the
	computer appears to be stuck by what you've done) you can
	save all that you have successfully loaded and continue from
	where things got wierd by doing the following: Type
<call>		
		That's the key in the upper right hand corner.
"↑C"
.		
		The period means you are now back to the monitor level 
		where you were
		before you typed R NEWMUS.  Now to recover, type
S<cr>
		That is, type S then the <return_key>.
"INPUT"
		Now you are back to the first computer response after
		the R NEWMUS command, but everything the computer
		accepted from you up to the point you goofed is still
		there (such as the arrays you declaired, the 
		instrument, etc.)
**********

       First  it  is  necessary to  connect  the  digital  to  analog
       converter (DAC or  DA) to a loudspeaker, either the four track
       facility in the music room or the monitor speaker  attached to
       your console.   The easiest  thing is  to hook up  the console
       speaker for which you type: 
<break>3U 
       This will not show up on the console.   
	You could also have typed
<escape>3U 
	to select the DAC but you would also allow paging interruption.
	There is  a  volume knob  attached to  the  speaker box,  turn it  to
	half-way. Type:

R NEWMUS<cr>

		NEWMUS is a music compiler which will take all the following
		information and from it compute a waveform and play it.

"INPUT?"

                When NEWMUS says this, it is expecting a file name.  We're
               not dealing with that but when you learn to set up files,
		it is to this question that you would type the file name.
		so type:
<cr>
                (that means carriage return).  
		NEWMUS will type:
">"
  		O.k., now NEWMUS will accept input from your console.
		Type:
ARRAY F2(512);<cr>

"ARRAY-F2"      	

">"
               This creates an array of 512 locations numbered from 0
               to 511 in which we will store the shape of a wave used
               in our basic instrument.  The array is called F2.   F1
               is  already  supplied  by  NEWMUS   and  is  loaded
               automatically  with numbers representing  a sine wave.
               The name F2  ("function" 2) is arbitrary.  

       This  terminates the  list of  declarations  required for  our
       purposes.   There could  also be  other things here  such as  a
       VARIABLE statement,  which  just  says  that  such-and-such  a
       letter or  word, etc. exists as  a location in the  memory that
       can  store a value.  

	       Now to  specify the shape  of the array, type: 
SEG(F2);<cr>
		You will be put into a graphic representational
        	mode. Don't be impatient, it may take awhile.
		Type: (Please note the necessary spaces in the following)
0 0 1 10 0 100<CR>
                and note the result.  The first number is the amplitude
		(y axis), the second is the x axis increment at which this
		amplitude will be.  Succeeding pairs of numbers just continue
		this process until the number 100 is reached. 
                After you type the last <cr>, the function will display. 
                To end the display type:
0<cr>
">"
		If you want to see what the function looks like again, type:
SEE(F2);<cr>
        	When you're through, type:
0<cr>
		F1 was supplied by NEWMUS and was constructed by SYNTH,
		which operates like SEG. You can change F1 if you like, type:
SYNTH(F1);<cr>
		Again, you are in graphical representation.  This time
		the format is different. Synth creates sine waves. Type:
2 1 <cr>	
		After a second or so  a sine wave with two periods will
		display. Of the two numbers you typed, the first specified
		the frequency, the second the amplitude. To terminate this
		mode type:
999<cr>
		But lets reset F1 to a sine wave for the next example, so
		go back and
SYNTH(F1);<cr>
		and type to the graphics:
1 1 999<cr>
		It will display a single period sine wave briefly, then
">"

        Next comes the instrument definition. Type:
INSTRUMENT FUT; OUTA←OSCIL(2000,P3*MAG,F1); END;
		<Note:to type the left arrow,depress the <TOP> key, 
 		Then the "J" key,on "top" of which  lives the left arrow.>

"INSTRUMENT-FUT"  
		That tells you you did everything o.k. and that FUT 
		exists as a valid instrument. If NEWMUS detected an
		error, it will tell you approximately where and what
		it is. Unfortunately, since you are not putting this
		in from a file you must retype the whole instrument
		deffinition. 
	WHAT IT MEANS:
	An instrument deffinition is delimited by the "INSTRUMENT<name>;"
	statement, and an "END;" statement.

	"OSCIL(<varaible>,<variable>,<array_name>);" is called a "Unit
	Generator" and is a special procedure which actually generates
	the numbers which represent to the DAC what the waveform is.
	The variables OSCIL expects are firstly, the amplitude (scaled
	arbitrarily up to a maximum value of 131072), and secondly
	the frequency of the note to be played. The third thing it wants
	is the array that specifies the waveshape.
	
	Where it says "P3" in the OSCIL statement, that tells OSCIL that
	the variable (or number) it is looking for is actually in the
	PLAY statement, in the third field after the name of the instrument.
	In this case, the number will be 440, to play the pitch "A".
	The PLAY statement is described below.

	MAG is  the magic number  specifying the  ratio of 512/sample  rate.
	The  length of stored functions  in NEWMUS is 512  samples long.  The
	ratio (512/sampling  rate) establishes  a base  frequency which  when
	multiplied by  the desired frequency  number (in this  case,P3) will
	sample  the  512  increment long  function  at  intervals  which will
	produce the desired frequency. 

	OUTA is a special variable that stores the value of each number
	the instrument writes, and sends it to channel A, or 1. There
	are three others, OUTB,OUTC,OUTD for the other channels.

		Now we are ready to tell NEWMUS to compute a waveform. Type:

PLAY DA:1.0; FUT 0 1 440; FINISH;		

	Please note  that  following the  DA is  a colon.   The  mark
	between the "1.0" is a period.
	It is possilbe that you will get a message like:
	"XGP in use. Wait for it to finish?"
	If this happens, type:
Y<cr>
	and wait for it. Meanwhile:
	Question #2001: what does the XGP have to do with playing
	sounds from NEWMUS? Answer, they both rely upon the PDP-6
	which ain't big enough for both of them.

Now the  computer is gobbling  up your data  and spewing  out numbers
into  an output  file.  It  should be  left alone. This  sound seldom
takes  more  than   a  minute  to  compute.     Longer  sounds   take
proportionally more time.   You should have either  fired up the four
track setup, or attached your monitor speaker
to the DA, because suddenly,  when you least expect it, a  sound well
LEAP! out at you. 

If you wish to hear it again, type:
∀ <alt>P<cr><alt>   When you type the second <alt>, you get the sound again.

To make the sound louder, turn the volume knob to the right.


To leave the NEWMUS environment, type:
<alt> EXIT
"EXIT"
"↑C"
And you are back to the monitor.